<?php $this->pageTitle = "Account"; ?>
<?php Yii::app()->publishAndRegisterCssFile($_SERVER['DOCUMENT_ROOT'] . '/css/app.account.login.custom.css'); ?>

<div class="main_container container_16">
	<div class="flat_area">
		<div class="grid_16">
			<div id="login_box_wrapper" class="relative">
				<div id="agency-login-header" class="align-center">
					<?php if ($agency != null): ?>
						<img src="<?php echo $agency->logo; ?>" alt="<?php echo $agency->name; ?>" class="agency-logo" style="max-width: 400px;" /><br/>
						<h1>Welcome to <?php echo ucwords(strtolower($agency->name)); ?></h1>
					<?php else: ?>
						<?php if ($mode == 'Agency'): ?>
							<img src="/images/house_prestige_200x96.png" width="200" style="margin-top: 0px;" />
						<?php else: ?>
							<img src="/images/logo_topachiever_v1_200x73.png" width="200" style="margin-top: 0px;" />
						<?php endif; ?>

						<br/>
					<?php endif; ?>
				</div>

				<?php
				$form = $this->beginWidget('CActiveForm', array(
					'id' => 'login-form',
					'action' => $this->createUrl($this->route),
					'enableAjaxValidation' => true,
					'htmlOptions' => array(
						'class' => 'form',
					)
						));
				?>
				<?php echo $form->errorSummary($model); ?>
				<div id="login_box" class="section">
					<div class="block">
						<h2><?php echo $mode; ?> Login</h2>
						<label class="fields">
							<strong>Username:</strong>
							<?php echo $form->textField($model, 'username', array('class' => 'indent', 'autocomplete' => 'off')); ?>
						</label>
						<label class="fields">
							<strong>Password</strong>
							<?php echo $form->passwordField($model, 'password', array('class' => 'indent', 'autocomplete' => 'off')); ?>
						</label>

						<button class="button_colour" type="submit" name="Login">
							<img width="24" height="24" src="/themes/adminica/images/icons/small/white/locked_2.png" alt="Locked 2">
							<span>Login</span>
				<!--            <img src="/images/home/logo_propsage_50x26.png" width="50" height="26" />-->
						</button>
						<div id="signup-now" class ="row">
							Don't have a account? <br/><?php echo CHtml::link("Sign up now", array('account/identify'), array('class' => 'link')); ?>
						</div>

						<div class="clear"></div>
						<div id="bar" class="">
							<label><?php echo $form->checkBox($model, 'rememberMe', array('checked' => true)); ?>Auto-login in future.</label>
							<?php echo CHtml::link('Forget your Password?', array('account/forgetPassword'), array('class' => 'blue link float-right')); ?>
						</div>
					</div>
				</div>

				<?php $this->endWidget(); ?>
			</div>

			<div id="agency-login-footer" class="align-center">
				<div class="powered-by">
				</div>
				<p>
					&copy;<?php echo date('Y'); ?> PropSage - 
					<a href="/terms.html">Terms of Use</a>&nbsp;|&nbsp;
					<a href="/privacy.html">Privacy</a>&nbsp;|&nbsp;
					<a href="/aboutus.html">About Us</a>
				</p>
			</div><!-- footer -->
		</div>
	</div>
</div>